package main

import (
	"fmt"
	"ginchat/models/mysqlModel"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

func main()  {
	db,err := gorm.Open(mysql.Open("root:123456abc@tcp(127.0.0.1:3306)/ginchat?charset=utf8&parseTime=True&loc=Local"))
	if err != nil{
		fmt.Println("数据库连接失败")
	}
	//自动创建表
	db.AutoMigrate(&mysqlModel.Community{})
}
